package com.zz.chenko.sys.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Zhong
 * @since 2017-05-16
 */
@Controller
@RequestMapping("/sys/menu")
public class MenuController {

    /**
     * 将当前激活的菜单路径存到session中
     * 
     * @param request 请求对象
     * @param activeMenu 当前激活的菜单路径
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "setActiveMenu", method = RequestMethod.POST)
    public String setActiveMenu(HttpServletRequest request, String activeMenu) {
        HttpSession session = request.getSession();
        session.setAttribute("activeMenu", activeMenu);
        return "ok";
    }
}
